package com.ygqh.baby.service;

import java.util.List;

import com.ygqh.baby.ao.Message;
import com.ygqh.baby.ao.OrderType;
import com.ygqh.baby.model.YgProvinceModel;
import com.ygqh.baby.model.YgShoppingCarModel;
import com.ygqh.baby.model.YgUserAddressModel;
import com.ygqh.baby.po.YgUserAddress;

public interface YgUserAddressService {

	List<YgUserAddressModel> find(Long userId);

	YgUserAddressModel findDefaultUserAddress(Long userId, Long userAddressId);

	int findCount();

	YgUserAddress findById(Long id, Long userId);

	int deleteSoft(Long[] ids, Long userId);

	int deleteSoft(Long id, Long userId);

	int save(YgUserAddress ygUserAddress);

	int update(YgUserAddress ygUserAddress);

	/**
	 * 新增收货地址
	 * 
	 * @param id
	 * @param receiver
	 * @param telPhone
	 * @param provinceName
	 * @param cityName
	 * @param areaName
	 * @param address
	 * @param postCode
	 * @param isDefault
	 * @return
	 */
	int addUserAddress(Long id, String receiver, String telPhone, String provinceName, String cityName, String areaName, String address, String postCode,
			Boolean isDefault);

	/**
	 * 修改收货地址
	 * 
	 * @param userId
	 * @param addressId
	 * @param receiver
	 * @param telPhone
	 * @param provinceName
	 * @param cityName
	 * @param areaName
	 * @param address
	 * @param postCode
	 * @param isDefault
	 * @return
	 */
	int updateUserAddress(Long userId, Long addressId, String receiver, String telPhone, String provinceName, String cityName, String areaName, String address,
			String postCode, Boolean isDefault);

	/**
	 * 根据id获取收货地址信息
	 * 
	 * @param userAddressId
	 * @param userId
	 * @return
	 */
	YgUserAddressModel findUserAddressById(Long userAddressId, Long userId);

	List<YgProvinceModel> findCityList();

	int transferUserAddr(Long id, Long id2);
	
	/**
	 * 下单时校验收货地址
	 * 
	 * @param userId
	 *            操作用户id
	 * @param userAddressId
	 *            收货地址id
	 * @param identityNo
	 *            收货人身份证号
	 * @param carModelList
	 *            购物车信息
	 * @param orderType
	 *            订单类型
	 * @return
	 */
	Message validateUserAddress(Long userId, Long userAddressId, String identityNo, List<YgShoppingCarModel> carModelList, OrderType orderType);

	Message validateUserAddressV2(Long userId, Long userAddressId, String identityNo, List<Long> supplierIds, OrderType orderType);

}
